# Author:	gong_libin
# Date:		2017_11_01

CC = g++
CFLAGS ?= -g -Wall

CM_ENV ?= $(shell pwd)/../..
CM_BIN ?= $(CM_ENV)/bin
CM_INC ?= $(CM_ENV)/inc
CM_SRC ?= $(CM_ENV)/src

CM_GLIB ?= /usr/lib64
CM_GINC ?= /usr/include/CmInc

CM_LIBS =					\
	-L$(CM_GLIB) -lcmglobal			\
	-L$(CM_GLIB) -lpthread			\
	-L$(CM_GLIB) -ldl

CM_OBJECTS =					\
	CmSspEng.o

CM_TARGETS =					\
	CmSspEng

all: $(CM_OBJECTS) $(CM_TARGETS)

$(CM_OBJECTS): %.o: %.cpp
	$(CC) -c $(CFLAGS) -I$(CM_INC) -I$(CM_GINC) $< -o $@

$(CM_TARGETS): %: %.o
	$(CC) $(CFLAGS) $< -o $@ $(CM_LIBS)

clean:
	rm -rf $(CM_OBJECTS)
	rm -rf $(CM_TARGETS)
